package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author 王鹤蒲
 * @since 2023-08-31
 */
@Data
@Accessors(chain = true)
@TableName("sys_comment")
@ApiModel(value = "Comment对象", description = "")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("评论者ID")
    private Integer commentatorId;

    @ApiModelProperty("评论时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime commentTime;

    @ApiModelProperty("父ID")
    private Integer pid;

    @TableField(exist=false)
    private String pUserName;

    @TableField(exist=false)
    private Integer pUserId;

    @ApiModelProperty("最上级评论ID")
    private Integer originId;

    @ApiModelProperty("关联文章ID")
    private Integer articleId;

    @ApiModelProperty("回复数量")
    private Integer replies;

    @ApiModelProperty("评论状态")
    private String status;

    @ApiModelProperty("删除标志")
    private String delFlag;

    @ApiModelProperty("更新者")
    private String updateBy;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty("备注")
    private String remark;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private String avatar;


    @TableField(exist = false)
    private List<Comment> childrenList;
}
